<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<ui:composition 
	  xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      template="/view/templates/templateLayout.xhtml">
      
      <ui:define name="conteudo">  
      <link rel="stylesheet" type="text/css" href="./estilos.css"/>     	
  	
<h:form id="formConsultarContaPagar">  
	<p:panel id="panelConsultarContaPagar" style="margin-bottom:20px; "> 
	<f:facet name="header">
		<h:outputText value="Consultar Conta a Pagar" styleClass="outputTextTitulo"/>
	</f:facet> 
 	<p:growl id="growl" showDetail="true"/> 
    	<h:panelGrid id="pgContaPagar" columns="2" style="margin-top:20px; margin-right:10%;">  
            <h:outputLabel value="Código" styleClass="outputLabel" />  
            <h:outputLabel value="Data" styleClass="outputLabel" /> 
            <p:inputText value="#{contaPagarBean.contaPagar.idContaPagar}" styleClass="inputId"/>  
  			<p:inputMask value="#{contaPagarBean.contaPagar.dtVencimento}" mask="99/99/9999" >
  				<f:convertDateTime dateStyle="medium"/>
  			</p:inputMask>
        </h:panelGrid>  
        <h:panelGrid id="pgFornecedor" columns="2" >  
            <h:outputLabel value="Código" styleClass="outputLabel" />  
            <h:outputLabel value="Fornecedor" styleClass="outputLabel" /> 
            <p:inputText value="#{contaPagarBean.contaPagar.fornecedor.idFornecedor}" styleClass="inputId"/>  
  			<p:inputText value="#{contaPagarBean.contaPagar.fornecedor.razaoSocial}" styleClass="inputDescricao"/>  
        </h:panelGrid> 
    </p:panel>  
    <p:commandButton value="Consultar" actionListener="#{contaPagarBean.findContaPagar}" update="dataTableContaPagar" style="margin-right:20px; margin-left:10px;" /> 
	<p:commandButton value="Novo" action="#{contaPagarBean.newContaPagar}" style="margin-right:20px;" /> 
	<p:commandButton value="Limpar"  actionListener="#{contaPagarBean.clean}" style="margin-right:20px;" />
    		
   		
    <p:dataTable id="dataTableContaPagar" var="ContaPagar"  value="#{contaPagarBean.dmContaPagar}"
    			 rowKey="#{ContaPagar.idContaPagar}"  selectionMode="single"
                 style="padding-top:20px; width:70%">  
        <f:facet name="header">Contas a Pagar</f:facet>    
		<p:column style="width:10%">  
            <f:facet name="header">  
                <h:outputText value="Código" />  
            </f:facet>  
            <h:outputText value="#{ContaPagar.idContaPagar}" />  
        </p:column>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Fornecedor" />  
            </f:facet>  
            <h:outputText value="#{ContaPagar.fornecedor.razaoSocial}" />  
        </p:column>
        
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="Descrição" />  
            </f:facet>  
            <h:outputText value="#{ContaPagar.descricao}" />  
        </p:column>
          
        <p:column style="width:10%">  
            <f:facet name="header">  
                <h:outputText value="Data" />  
            </f:facet>  
            <h:outputText value="#{ContaPagar.dtVencimento}" >
            	<f:convertDateTime dateStyle="medium"/>
            </h:outputText>  
        </p:column>
        
        <p:column style="width:10%">  
            <f:facet name="header">  
                <h:outputText value="Valor" />  
            </f:facet>  
            <h:outputText value="#{ContaPagar.valor}" >
            	<f:convertNumber type="currency" currencySymbol="R$"/>>
            </h:outputText>  
        </p:column>
        
        <p:column style="width:4%">  
        	<f:facet name="header">
        	 <h:outputText value="Editar" />
        	</f:facet>
         	<p:commandButton id="selectButtonEditar" action="#{contaPagarBean.editarContaPagar}" icon="ui-icon-pencil" title="Detail" />
        </p:column> 
    </p:dataTable>   
 
</h:form>  	


</ui:define>
</ui:composition>
